package cn.hl.system.listener;

import cn.hl.system.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class PermissionScanInitListener implements ServletContextListener {

    @Autowired
    private IPermissionService permissionService;

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("监听到了上下文对象的创建");
        permissionService.scanPermission();
        System.out.println("扫描自定义注解");
        System.out.println("监听完毕！");
    }
}
